package com.menker.app;


import com.alibaba.baichuan.android.trade.AlibcTradeSDK;
import com.alibaba.baichuan.android.trade.callback.AlibcTradeInitCallback;
import com.menker.app.common.BaseApp;
import com.menker.app.common.Utils;
import com.menker.app.di.module.AppModule;

import javax.inject.Singleton;

import autodagger.AutoComponent;

/**
 * @author J.Huang
 * @version 1.0
 */

@AutoComponent(modules = AppModule.class)
@Singleton
public class MyApp extends BaseApp {

    @Override
    public void onCreate() {
        super.onCreate();

        AlibcTradeSDK.asyncInit(this, new AlibcTradeInitCallback() {
            @Override
            public void onSuccess() {
                //初始化成功，设置相关的全局配置参数
            }

            @Override
            public void onFailure(int code, String msg) {
                //初始化失败，可以根据code和msg判断失败原因，详情参见错误说明
                Utils.UI.showToastLong(getResources().getString(R.string.error_init_failed_taobao));
        }});
    }
}
